
package medOffice.Gui;

import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;

import javax.swing.ButtonGroup;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;

import medOffice.Configuracoes;
import medOffice.Verificador;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
/**
 * GUI para editar as configuracoes do Medico e da Clinica
 * 
 * @author Ana Clara Lacerda - anacls@lcc.ufcg.edu.br
 * @version 0.1 - 03/12/2009
 */
public class ConfiguracoesGUI {
	
	private JPanel configuraMedico;
	private static JPanel configuraClinica;
	private static JPanel configuraHorarios, mudaHorarios;
	private List<String> dadosClinica, dadosMedico;
	private Map<Integer, List<String>> horarios;
	private static JFrame frameAuxiliar;
	private static JFrame frameAuxiliar2;
	private static JFrame frameAuxiliar3;
	private JComboBox dddTel;

	private final String[] ARRAY_DDD = { "DDD", "11", "12", "13", "14", "15",
			"16", "17", "18", "19", "21", "22", "24", "27", "28", "31", "32",
			"33", "34", "35", "37", "38", "41", "42", "43", "44", "45", "46",
			"47", "48", "49", "51", "53", "54", "55", "61", "62", "63", "64",
			"65", "66", "67", "68", "69", "71", "73", "74", "75", "77", "79",
			"81", "82", "83", "84", "85", "86", "87", "88", "89", "91", "92",
			"93", "94", "95", "96", "97", "98", "99" };
	// copiando do cadastro
	private int posicaoX, posicaoY;
	private List<String> hSeg, hTer, hQua, hQui, hSex, hSab, hDom;
	private JLabel formatoNascimento;
	private JButton botaoTer;
	private JTextArea explicacao;
	private ButtonGroup escolhaSexo;
	private JRadioButton sexoM;
	private JRadioButton sexoF;
	private JTextField telefoneParte2;
	private JButton limpa2;
	private JTextArea aboutMedico;
	private JTextArea passo3;
	private JTextArea saudacao2;
	private JTextArea passo2;
	private JTextArea saudacao;
	private JTextField telefone2;
	private JButton limpar1;
	private JTextArea proximoPasso;
	private JTextArea aboutMedOffice;
	private JTextArea jTextArea1;
	private JLabel trabalho;
	private JCheckBox trabalhaTerca;
	private JCheckBox trabalhaSabado;
	private JCheckBox trabalhaSexta;
	private JCheckBox trabalhaQuinta;
	private JCheckBox trabalhaQuarta;
	private JCheckBox trabalhaSegunda;
	private JCheckBox tDom;
	private JLabel labelSaida;
	private JLabel labelEntrada;
	private JLabel nomehorarios;
	private JButton botaoSab;
	private JButton botaoSex;
	private JButton ok;
	private JTextArea aboutClinica;
	private JCheckBox executa;
	private JTextArea informacao;
	private JTextArea saudacao4;
	private JButton botaoQui;
	private JButton botaoQuarta;
	private JButton botaoSeg;
	private JButton botaoDom;
	private JTabbedPane tabbed;
	// atributos copiados
	
	public ConfiguracoesGUI(JTabbedPane tabbed) {
		this.tabbed = tabbed;
	}
	
	public void editaClinica() throws IOException {
		configuraClinica = new JPanel();
		
		//copiando
		JButton salvar = new JButton("Salvar");
		
		GroupLayout panelLayout1 = new GroupLayout((JComponent) configuraClinica);
		configuraClinica.setLayout(panelLayout1);
		
		salvar.setBackground(new java.awt.Color(14, 71, 14));
		salvar.setSize(91, 21);
		salvar.setForeground(new java.awt.Color(85, 232, 85));
		

		final JTextField nome = new JTextField("", 20);
		final JTextField endereco = new JTextField("", 20);
		final JTextField telefone = new JTextField("", 12);
		nome.setText(Configuracoes.getDadosDaClinica().get(0));
		endereco.setText(Configuracoes.getDadosDaClinica().get(1));
		telefone.setText(Configuracoes.getDadosDaClinica().get(2).substring(5, 8));	
		getTelefoneParte2().setText(Configuracoes.getDadosDaClinica().get(2).substring(10, 13));
		
		ComboBoxModel dddTelModel = new DefaultComboBoxModel(ARRAY_DDD);
		dddTel = new JComboBox();
		dddTel.setModel(dddTelModel);
		dddTel.setMaximumRowCount(25);

		JLabel labelNome = new JLabel("*Nome da Clinica: ");
		JLabel labelEndereco = new JLabel("*Endereco: ");
		JLabel labelTelefone = new JLabel("*Telefone: ");
		panelLayout1.setVerticalGroup(panelLayout1.createSequentialGroup()
				.addContainerGap(26, 26).addComponent(getSaudacao(),
						GroupLayout.PREFERRED_SIZE, 36,
						GroupLayout.PREFERRED_SIZE).addPreferredGap(
						LayoutStyle.ComponentPlacement.UNRELATED)
				.addComponent(getPasso2(), GroupLayout.PREFERRED_SIZE, 85,
						GroupLayout.PREFERRED_SIZE).addGap(46).addGroup(
						panelLayout1.createParallelGroup(
								GroupLayout.Alignment.BASELINE)
								.addComponent(nome,
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE)
								.addComponent(labelNome,
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE))
				.addGap(24).addGroup(
						panelLayout1.createParallelGroup(
								GroupLayout.Alignment.BASELINE)
								.addComponent(endereco,
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE)
								.addComponent(labelEndereco,
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE))
				.addGap(31).addGroup(
						panelLayout1.createParallelGroup(
								GroupLayout.Alignment.BASELINE)
								.addComponent(dddTel,
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE)
								.addComponent(labelTelefone,
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE)
								.addComponent(telefone,
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE)
								.addComponent(getJTextField1(),
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE))
				.addGap(126).addGroup(
						panelLayout1.createParallelGroup(
								GroupLayout.Alignment.BASELINE)
								
								.addComponent(salvar,
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.PREFERRED_SIZE)
								.addComponent(getLimpar1(),
										GroupLayout.Alignment.BASELINE,
										GroupLayout.PREFERRED_SIZE, 21,
										GroupLayout.PREFERRED_SIZE))
				.addContainerGap(100, 100));
		panelLayout1
				.setHorizontalGroup(panelLayout1
						.createSequentialGroup()
						.addContainerGap(32, 32)
						.addGroup(
								panelLayout1
										.createParallelGroup()
										.addGroup(
												GroupLayout.Alignment.LEADING,
												panelLayout1
														.createSequentialGroup()
														.addGroup(
																panelLayout1
																		.createParallelGroup()
																		.addGroup(
																				panelLayout1
																						.createSequentialGroup()
																						.addGroup(
																								panelLayout1
																										.createParallelGroup()
																										.addComponent(
																												labelNome,
																												GroupLayout.Alignment.LEADING,
																												GroupLayout.PREFERRED_SIZE,
																												GroupLayout.PREFERRED_SIZE,
																												GroupLayout.PREFERRED_SIZE)
																										.addGroup(
																												GroupLayout.Alignment.LEADING,
																												panelLayout1
																														.createSequentialGroup()
																														.addComponent(
																																labelTelefone,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.PREFERRED_SIZE)
																														.addGap(
																																46))
																										.addGroup(
																												GroupLayout.Alignment.LEADING,
																												panelLayout1
																														.createSequentialGroup()
																														.addComponent(
																																labelEndereco,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.PREFERRED_SIZE)
																														.addGap(
																																40)))
																						.addPreferredGap(
																								LayoutStyle.ComponentPlacement.RELATED)
																						.addGroup(
																								panelLayout1
																										.createParallelGroup()
																										.addGroup(
																												GroupLayout.Alignment.LEADING,
																												panelLayout1
																														.createSequentialGroup()
																														.addComponent(
																																dddTel,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.PREFERRED_SIZE)
																														.addGap(
																																16)
																														.addComponent(
																																telefone,
																																GroupLayout.PREFERRED_SIZE,
																																70,
																																GroupLayout.PREFERRED_SIZE)
																														.addPreferredGap(
																																LayoutStyle.ComponentPlacement.UNRELATED)
																														.addComponent(
																																getJTextField1(),
																																GroupLayout.PREFERRED_SIZE,
																																70,
																																GroupLayout.PREFERRED_SIZE)
																														.addGap(
																																8))
																										.addComponent(
																												endereco,
																												GroupLayout.Alignment.LEADING,
																												GroupLayout.PREFERRED_SIZE,
																												GroupLayout.PREFERRED_SIZE,
																												GroupLayout.PREFERRED_SIZE)
																										.addComponent(
																												nome,
																												GroupLayout.Alignment.LEADING,
																												GroupLayout.PREFERRED_SIZE,
																												GroupLayout.PREFERRED_SIZE,
																												GroupLayout.PREFERRED_SIZE)))
																		.addGroup(
																				GroupLayout.Alignment.LEADING,
																				panelLayout1
																						.createSequentialGroup()
																						.addComponent(
																								getSaudacao(),
																								GroupLayout.PREFERRED_SIZE,
																								306,
																								GroupLayout.PREFERRED_SIZE)
																						.addGap(
																								46)))
														.addComponent(
																getLimpar1(),
																GroupLayout.PREFERRED_SIZE,
																91,
																GroupLayout.PREFERRED_SIZE))
										.addGroup(
												GroupLayout.Alignment.LEADING,
												panelLayout1
														.createSequentialGroup()
														.addPreferredGap(
																labelTelefone,
																getPasso2(),
																LayoutStyle.ComponentPlacement.INDENT)
														.addComponent(
																getPasso2(),
																GroupLayout.PREFERRED_SIZE,
																424,
																GroupLayout.PREFERRED_SIZE)
														.addGap(7)))
						.addGap(26).addGap(18)
						.addComponent(salvar, GroupLayout.PREFERRED_SIZE,
								GroupLayout.PREFERRED_SIZE,
								GroupLayout.PREFERRED_SIZE)
						.addContainerGap(108, Short.MAX_VALUE));

		limpar1.addActionListener((new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				nome.setText("");
				endereco.setText("");
				telefone.setText("");
				telefone2.setText("");
				dddTel.setSelectedIndex(0);
			}
		}));
		
		configuraClinica.setBackground(new java.awt.Color(191, 236, 191));

		salvar.addActionListener((new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				try {
					String telefoneClinica = "("
							+ (String) dddTel.getSelectedItem() + ") "
							+ telefone.getText() + "-"
							+ telefone2.getText();
					List<String> dados = new ArrayList<String>();
					if (!Verificador.verificaNome(nome.getText()))
						JOptionPane.showMessageDialog(null, "Nome invalido",
								"Atenção!", JOptionPane.PLAIN_MESSAGE);
					if (!Verificador.verificaEndereco(endereco.getText()))
						JOptionPane.showMessageDialog(null, "Endereco invalido",
								"Atenção!", JOptionPane.PLAIN_MESSAGE);
					if (!Verificador.verificaTelefone(telefoneClinica))
						JOptionPane.showMessageDialog(null, "Telefone invalido",
								"Atenção!", JOptionPane.PLAIN_MESSAGE);
					dados.add(nome.getText());
					dados.add(endereco.getText());
					dados.add(telefoneClinica);
					Configuracoes.salvaClinica(dados);
				} catch (Exception e) {
					JOptionPane.showMessageDialog(null, e.getMessage(),
							"Atenção!", JOptionPane.PLAIN_MESSAGE);
				}
			}

		}));
	}

	
	
	private void editaHorarios() {
		try {
		horarios = Configuracoes.getHorarios();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		configuraHorarios = new JPanel();
		GroupLayout configuraHorariosLayout = new GroupLayout((JComponent)configuraHorarios);
		configuraHorarios.setLayout(configuraHorariosLayout);
		
		GroupLayout panelLayout3 = new GroupLayout((JComponent) configuraHorarios);
		configuraHorarios.setLayout(panelLayout3);
		configuraHorarios.setBackground(new java.awt.Color(191, 236, 191));
		
		{
			botaoQuarta = new JButton();
			botaoQuarta.setText("QUA");
			botaoQuarta.setSize(67, 34);
			botaoQuarta.setBackground(new java.awt.Color(37, 101, 37));
			botaoQuarta
					.setForeground(new java.awt.Color(144, 238, 144));
		}
		{
			botaoTer = new JButton();
			botaoTer.setText("TER");
			botaoTer.setSize(67, 34);
			botaoTer.setBackground(new java.awt.Color(37, 101, 37));
			botaoTer.setForeground(new java.awt.Color(144, 238, 144));
		}
		{
			botaoSab = new JButton();
			botaoSab.setText("SAB");
			botaoSab.setSize(67, 34);
			botaoSab.setBackground(new java.awt.Color(37, 101, 37));
			botaoSab.setForeground(new java.awt.Color(144, 238, 144));
		}
		{
			botaoSeg = new JButton();
			botaoSeg.setText("SEG");
			botaoSeg.setSize(67, 34);
			botaoSeg.setBackground(new java.awt.Color(37, 101, 37));
			botaoSeg.setForeground(new java.awt.Color(144, 238, 144));
		}
		{
			botaoSex = new JButton();
			botaoSex.setText("SEX");
			botaoSex.setSize(67, 34);
			botaoSex.setBackground(new java.awt.Color(37, 101, 37));
			botaoSex.setForeground(new java.awt.Color(144, 238, 144));
		}
		{
			botaoDom = new JButton();
			botaoDom.setText("DOM");
			botaoDom.setBackground(new java.awt.Color(37, 101, 37));
			botaoDom.setForeground(new java.awt.Color(144, 238, 144));
		}
		{
			botaoQui = new JButton();
			botaoQui.setText("QUI");
			botaoQui.setSize(67, 34);
			botaoQui.setBackground(new java.awt.Color(37, 101, 37));
			botaoQui.setForeground(new java.awt.Color(144, 238, 144));
		}
		panelLayout3.setVerticalGroup(panelLayout3.createSequentialGroup()
			.addContainerGap(23, 23)
			.addComponent(getTrabalho(), GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
			.addGroup(panelLayout3.createParallelGroup()
			    .addComponent(getJTextArea1(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
			    .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			        .addGap(17)
			        .addComponent(getJCheckBox1(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			        .addGap(14)
			        .addComponent(getJCheckBox1x(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			        .addGap(15)
			        .addComponent(getJCheckBox2(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			        .addGap(13)
			        .addComponent(getJCheckBox3(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)))
			.addGap(13)
			.addComponent(getJCheckBox4(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			.addGap(15)
			.addComponent(getJCheckBox5(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			.addGap(16)
			.addComponent(getJCheckBox6(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			.addGap(51)
			.addComponent(getNomehorarios(), GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
			.addGap(20)
			.addGroup(panelLayout3.createParallelGroup(GroupLayout.Alignment.BASELINE)
			    .addComponent(botaoQuarta, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
			    .addComponent(botaoSex, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
			    .addComponent(botaoSab, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
			    .addComponent(botaoQui, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
			    .addComponent(botaoTer, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
			    .addComponent(botaoDom, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
			    .addComponent(botaoSeg, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 33, GroupLayout.PREFERRED_SIZE))
			.addGap(37)
			.addComponent(getOk(), GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
			.addContainerGap(69, Short.MAX_VALUE));
		panelLayout3.setHorizontalGroup(panelLayout3.createSequentialGroup()
			.addContainerGap(28, 28)
			.addGroup(panelLayout3.createParallelGroup()
			    .addGroup(panelLayout3.createSequentialGroup()
			        .addGroup(panelLayout3.createParallelGroup()
			            .addComponent(getTrabalho(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 181, GroupLayout.PREFERRED_SIZE)
			            .addGroup(panelLayout3.createSequentialGroup()
			                .addGap(20)
			                .addGroup(panelLayout3.createParallelGroup()
			                    .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                        .addComponent(getJCheckBox1x(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			                        .addGap(52))
			                    .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                        .addComponent(getJCheckBox3(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			                        .addGap(65))
			                    .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                        .addGroup(panelLayout3.createParallelGroup()
			                            .addComponent(getJCheckBox4(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			                            .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                                .addComponent(botaoDom, GroupLayout.PREFERRED_SIZE, 67, GroupLayout.PREFERRED_SIZE)
			                                .addGap(27))
			                            .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                                .addComponent(getJCheckBox1(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			                                .addGap(21))
			                            .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                                .addComponent(getJCheckBox2(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			                                .addGap(6))
			                            .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                                .addComponent(getJCheckBox5(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			                                .addGap(6))
			                            .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                                .addComponent(getJCheckBox6(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
			                                .addGap(28)))
			                        .addComponent(botaoSeg, GroupLayout.PREFERRED_SIZE, 67, GroupLayout.PREFERRED_SIZE)))))
			        .addGap(21)
			        .addGroup(panelLayout3.createParallelGroup()
			            .addGroup(panelLayout3.createSequentialGroup()
			                .addGap(0, 0, Short.MAX_VALUE)
			                .addComponent(getJTextArea1(), GroupLayout.PREFERRED_SIZE, 484, GroupLayout.PREFERRED_SIZE))
			            .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                .addPreferredGap(getJTextArea1(), botaoTer, LayoutStyle.ComponentPlacement.INDENT)
			                .addComponent(botaoTer, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)
			                .addGap(25)
			                .addComponent(botaoQuarta, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)
			                .addGap(30)
			                .addComponent(botaoQui, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)
			                .addGap(17)
			                .addGroup(panelLayout3.createParallelGroup()
			                    .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                        .addComponent(botaoSex, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)
			                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
			                        .addComponent(botaoSab, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE))
			                    .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			                        .addGap(54)
			                        .addComponent(getOk(), GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE)))
			                .addGap(0, 13, Short.MAX_VALUE))))
			    .addGroup(GroupLayout.Alignment.LEADING, panelLayout3.createSequentialGroup()
			        .addComponent(getNomehorarios(), GroupLayout.PREFERRED_SIZE, 228, GroupLayout.PREFERRED_SIZE)
			        .addGap(0, 458, Short.MAX_VALUE)))
			.addContainerGap(56, 56));
		if (horarios.containsKey(Calendar.MONDAY)) {
			trabalhaSegunda.setSelected(true);
			hSeg = horarios.get(Calendar.MONDAY);
		} if (horarios.containsKey(Calendar.SUNDAY)) {
			tDom.setSelected(true);
			hDom = horarios.get(Calendar.SUNDAY);
		} if (horarios.containsKey(Calendar.TUESDAY)) {
			trabalhaTerca.setSelected(true);
			hTer = horarios.get(Calendar.TUESDAY);
		} if (horarios.containsKey(Calendar.WEDNESDAY)) {
			trabalhaQuarta.setSelected(true);
			hQua = horarios.get(Calendar.WEDNESDAY);
		} if (horarios.containsKey(Calendar.THURSDAY)) {
			trabalhaQuinta.setSelected(true);
			hQui = horarios.get(Calendar.THURSDAY);
		} if (horarios.containsKey(Calendar.FRIDAY)) {
			trabalhaSexta.setSelected(true);
			hSex = horarios.get(Calendar.FRIDAY);
		} if (horarios.containsKey(Calendar.SATURDAY)) {
			trabalhaSabado.setSelected(true);
			hSab = horarios.get(Calendar.SATURDAY);
		}
		{
			JButton close = new JButton("Fechar");
			getConfiguraHorarios().add(close);
			close.addActionListener((new java.awt.event.ActionListener() {
				@Override
				public void actionPerformed(ActionEvent arg0) {
					tabbed.remove(tabbed.indexOfTab("Configuracoes de Horarios"));

				}

			}));
			configuraHorarios.add(close);
		}
		
		botaoSeg.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						if (trabalhaSegunda.isSelected()) {
							if (hSeg == null) {
								hSeg = new ArrayList<String>();
							}
							mudaHorariosNaTela(hSeg);
						} else {
							JOptionPane
									.showMessageDialog(
											null,
											"Segunda-Feira não está marcada como dia de trabalho",
											"Atenção!",
											JOptionPane.PLAIN_MESSAGE);
						}
					}
					
				}));
		
	

		botaoTer
				.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						if (trabalhaTerca.isSelected()) {
							if (hTer == null) {
								hTer = new ArrayList<String>();
							}
							mudaHorariosNaTela(hTer);
						} else {
							JOptionPane
									.showMessageDialog(
											null,
											"Terça-Feira não está marcada como dia de trabalho",
											"Atenção!",
											JOptionPane.PLAIN_MESSAGE);
						}
					}

				}));

		botaoQuarta
				.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						if (trabalhaQuarta.isSelected()) {
							if (hQua == null) {
								hQua = new ArrayList<String>();
							}
							mudaHorariosNaTela(hQua);
						} else {
							JOptionPane
									.showMessageDialog(
											null,
											"Quarta-Feira não está marcada como dia de trabalho",
											"Atenção!",
											JOptionPane.PLAIN_MESSAGE);
						}
					}

				}));

		botaoQui
				.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						if (trabalhaQuinta.isSelected()) {
							if (hQui == null) {
								hQui = new ArrayList<String>();
							}
							mudaHorariosNaTela(hQui);
						} else {
							JOptionPane
									.showMessageDialog(
											null,
											"Quinta-Feira não está marcada como dia de trabalho",
											"Atenção!",
											JOptionPane.PLAIN_MESSAGE);
						}
					}

				}));

		botaoSex
				.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						if (trabalhaSexta.isSelected()) {
							if (hSex == null) {
								hSex = new ArrayList<String>();
							}
							mudaHorariosNaTela(hSex);
						} else {
							JOptionPane
									.showMessageDialog(
											null,
											"Sexta-Feira não está marcada como dia de trabalho",
											"Atenção!",
											JOptionPane.PLAIN_MESSAGE);
						}
					}

				}));

		botaoSab
				.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						if (trabalhaSabado.isSelected()) {
							if (hSab == null) {
								hSab = new ArrayList<String>();
							}
							mudaHorariosNaTela(hSab);
						} else {
							JOptionPane
									.showMessageDialog(
											null,
											"Sabado não está marcado como dia de trabalho",
											"Atenção!",
											JOptionPane.PLAIN_MESSAGE);
						}
					}

				}));

		botaoDom
				.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						if (tDom.isSelected()) {
							if (hDom == null) {
								hDom = new ArrayList<String>();
							}
							mudaHorariosNaTela(hDom);
						} else {
							JOptionPane
									.showMessageDialog(
											null,
											"Domingo não está marcado como dia de trabalho",
											"Atenção!",
											JOptionPane.PLAIN_MESSAGE);
						}
					}

				}));

	}


	
	
	private void editaMedico() {
		configuraMedico = new JPanel();
		
	}
	
	public JPanel getConfiguraClinica() throws IOException {
		if (configuraClinica == null)
			editaClinica();
		return configuraClinica;
	}
	
	public JPanel getConfiguraMedico() {
		if (configuraMedico == null)
			editaMedico();
		return configuraMedico;			
	}
	
	public JPanel getConfiguraHorarios() {
		if (horarios == null)
			editaHorarios();
		return configuraHorarios;
	}
	
	public static void main(String[] args) {
		frameAuxiliar = new JFrame();
		frameAuxiliar3 = new JFrame();
		frameAuxiliar2 = new JFrame();
		frameAuxiliar.add(configuraHorarios);
		frameAuxiliar2.add(mudaHorarios);
		frameAuxiliar3.add(configuraClinica);
		
	}
	
	private JLabel getNomehorarios() {
		if (nomehorarios == null) {
			nomehorarios = new JLabel();
			nomehorarios.setText("Horários (hh:mm) :");
			nomehorarios.setFont(new java.awt.Font("Dialog", 1, 12));
		}
		return nomehorarios;
	}

	private JLabel getLabelEntrada() {
		if (labelEntrada == null) {
			labelEntrada = new JLabel();
			labelEntrada.setText("Horário de Entrada (hh:mm)");
			labelEntrada.setBounds(12, 22, 199, 14);
		}
		return labelEntrada;
	}

	private JLabel getLabelSaida() {
		if (labelSaida == null) {
			labelSaida = new JLabel();
			labelSaida.setText("Horário de Saída (hh:mm)");
			labelSaida.setBounds(223, 22, 211, 14);
		}
		return labelSaida;
	}

	private JCheckBox getJCheckBox1() {
		if (tDom == null) {
			tDom = new JCheckBox();
			tDom.setText("Domingo");
			tDom.setOpaque(false);
		}
		return tDom;
	}

	private JCheckBox getJCheckBox1x() {
		if (trabalhaSegunda == null) {
			trabalhaSegunda = new JCheckBox();
			trabalhaSegunda.setText("Segunda-Feira");
			trabalhaSegunda.setOpaque(false);
		}
		return trabalhaSegunda;
	}

	private JCheckBox getJCheckBox2() {
		if (trabalhaTerca == null) {
			trabalhaTerca = new JCheckBox();
			trabalhaTerca.setText("Terça-Feira");
			trabalhaTerca.setOpaque(false);
		}
		return trabalhaTerca;
	}

	private JCheckBox getJCheckBox3() {
		if (trabalhaQuarta == null) {
			trabalhaQuarta = new JCheckBox();
			trabalhaQuarta.setText("Quarta-Feira");
			trabalhaQuarta.setOpaque(false);
		}
		return trabalhaQuarta;
	}

	private JCheckBox getJCheckBox4() {
		if (trabalhaQuinta == null) {
			trabalhaQuinta = new JCheckBox();
			trabalhaQuinta.setText("Quinta-Feira");
			trabalhaQuinta.setOpaque(false);
		}
		return trabalhaQuinta;
	}

	private JCheckBox getJCheckBox5() {
		if (trabalhaSexta == null) {
			trabalhaSexta = new JCheckBox();
			trabalhaSexta.setText("Sexta-Feira");
			trabalhaSexta.setOpaque(false);
		}
		return trabalhaSexta;
	}

	private JCheckBox getJCheckBox6() {
		if (trabalhaSabado == null) {
			trabalhaSabado = new JCheckBox();
			trabalhaSabado.setText("Sábado");
			trabalhaSabado.setOpaque(false);
		}
		return trabalhaSabado;
	}

	private JLabel getTrabalho() {
		if (trabalho == null) {
			trabalho = new JLabel();
			trabalho.setText("Dias de trabalho:");
			trabalho.setFont(new java.awt.Font("Dialog", 1, 12));
		}
		return trabalho;
	}

	private JTextArea getJTextArea1() {
		if (jTextArea1 == null) {
			jTextArea1 = new JTextArea();
			jTextArea1
					.setText("Está na hora de registrar os dias e horários de trabalho do Médico:\n\nMarque os dias de trabalho na lista da esquerda.\n\nEm seguida clique no dia ao qual você deseja adicionar horários e\nescreva os horários no formato solicitado.\nClique em 'Salvar' e faça o mesmo para os outros dias de trabalho.\nQuando tiver acabado clique em 'Próximo'.\n\n");
			jTextArea1.setOpaque(false);
			jTextArea1.setEditable(false);
			jTextArea1.setFont(new java.awt.Font("Monospaced", 0, 12));
			jTextArea1.setForeground(new java.awt.Color(64, 124, 64));
		}
		return jTextArea1;
	}

	private JTextArea getAboutMedOffice() {
		if (aboutMedOffice == null) {
			aboutMedOffice = new JTextArea();
			aboutMedOffice
					.setText("O Medical Secretary Office System (MedSecret) foi projetado e desenvolvido para\nauxiliar secretárias de quaisquer especialidades médicas.");
			aboutMedOffice.setOpaque(false);
			aboutMedOffice.setEditable(false);
		}
		return aboutMedOffice;
	}

	private JTextArea getProximoPasso() {
		if (proximoPasso == null) {
			proximoPasso = new JTextArea();
			proximoPasso
					.setText("Comece registrando a Clínica e o Médico no nosso sistema.\nPara isso clique em 'P\u0155oximo' e siga as intruções.");
			proximoPasso.setOpaque(false);
			proximoPasso.setEditable(false);
			proximoPasso.setFont(new java.awt.Font("Monospaced", 0, 12));
			proximoPasso.setForeground(new java.awt.Color(64, 124, 64));
		}
		return proximoPasso;
	}

	private JButton getLimpar1() {
		if (limpar1 == null) {
			limpar1 = new JButton();
			limpar1.setText("Limpar");
			limpar1.setBackground(new java.awt.Color(14, 71, 14));
			limpar1.setSize(91, 21);
			limpar1.setForeground(new java.awt.Color(85, 232, 85));
		}
		return limpar1;
	}

	private JTextField getJTextField1() {
		if (telefone2 == null) {
			telefone2 = new JTextField();
			telefone2.setColumns(12);
			telefone2.setText("");
		}
		return telefone2;
	}

	private JTextArea getSaudacao() {
		if (saudacao == null) {
			saudacao = new JTextArea();
			saudacao.setText("Editando Dados da Clinica");
			saudacao.setEditable(false);
			saudacao.setFont(new java.awt.Font("Purisa", 1, 14));
			saudacao.setOpaque(false);
			saudacao.setForeground(new java.awt.Color(23, 100, 23));
		}
		return saudacao;
	}

	private JTextArea getPasso2() {
		if (passo2 == null) {
			passo2 = new JTextArea();
			passo2.setText("Mude os dados que desejar e clique em 'Salvar'");
			passo2.setOpaque(false);
			passo2.setFont(new java.awt.Font("Monospaced", 0, 12));
			passo2.setForeground(new java.awt.Color(64, 124, 64));
			passo2.setEditable(false);
		}
		return passo2;
	}

	private JTextArea getSaudacao2() {
		if (saudacao2 == null) {
			saudacao2 = new JTextArea();
			saudacao2.setText("2ª etapa: Cadastrando o Médico");
			saudacao2.setOpaque(false);
			saudacao2.setEditable(false);
			saudacao2.setFont(new java.awt.Font("Purisa", 1, 14));
			saudacao2.setForeground(new java.awt.Color(23, 113, 23));
		}
		return saudacao2;
	}

	private JTextArea getPasso3() {
		if (passo3 == null) {
			passo3 = new JTextArea();
			passo3
					.setText("Para cadastrar o Médico informe os dados pedidos\ne clique em 'P\u0155oximo'.\n* Campos obrigatórios");
			passo3.setOpaque(false);
			passo3.setEditable(false);
			passo3.setFont(new java.awt.Font("Monospaced", 0, 12));
			passo3.setForeground(new java.awt.Color(64, 124, 64));
		}
		return passo3;
	}

	private JTextArea getSaudacao4() {
		if (saudacao4 == null) {
			saudacao4 = new JTextArea();
			saudacao4.setText("4ª etapa: Salvando os Dados");
			saudacao4.setEditable(false);
			saudacao4.setFont(new java.awt.Font("Purisa", 1, 14));
			saudacao4.setOpaque(false);
			saudacao4.setForeground(new java.awt.Color(16, 97, 16));
		}
		return saudacao4;
	}

	private JTextArea getInformacao() {
		if (informacao == null) {
			informacao = new JTextArea();
			informacao
					.setText("Dados recebidos com sucesso.\nClique em 'Finalizar' para salvar os dados no sistema.");
			informacao.setEditable(false);
			informacao.setOpaque(false);
			informacao.setFont(new java.awt.Font("Monospaced", 0, 12));
			informacao.setForeground(new java.awt.Color(64, 124, 64));
		}
		return informacao;
	}

	private JCheckBox getExecuta() {
		if (executa == null) {
		executa = new JCheckBox();
			executa.setText("Executar MedOffice depois de salvar os dados");
			executa.setOpaque(false);
		}
		return executa;
	}

	private JTextArea getAboutClinica() {
		if (aboutClinica == null) {
			aboutClinica = new JTextArea();
			aboutClinica.setOpaque(false);
		}
		return aboutClinica;
	}

	private JTextArea getJTextArea2() {
		if (aboutMedico == null) {
			aboutMedico = new JTextArea();
			aboutMedico.setOpaque(false);
		}
		return aboutMedico;
	}

	private JButton getLimpa2() {

		if (limpa2 == null) {
			limpa2 = new JButton();
			limpa2.setText("Limpar");
			limpa2.setBackground(new java.awt.Color(14, 71, 14));
			limpa2.setForeground(new java.awt.Color(85, 232, 85));
		}
		return limpa2;
	}

	private JTextField getTelefoneParte2() {
		if (telefoneParte2 == null) {
			telefoneParte2 = new JTextField();
		}
		return telefoneParte2;
	}

	private JRadioButton getSexoF() {
		if (sexoF == null) {
			sexoF = new JRadioButton();
			sexoF.setText("Feminino");
			sexoF.setOpaque(false);
		}
		return sexoF;
	}

	private JRadioButton getSexoM() {
		if (sexoM == null) {
			sexoM = new JRadioButton();
			sexoM.setText("Masculino");
			sexoM.setOpaque(false);
		}
		return sexoM;
	}

	private ButtonGroup getEscolhaSexo() {
		if (escolhaSexo == null) {
			escolhaSexo = new ButtonGroup();
		}
		return escolhaSexo;
	}

	private JTextArea getExplicacao() {
		if (explicacao == null) {
			explicacao = new JTextArea();
			explicacao.setText("Edite os Horários do dia:\n\nEscreva o horário de entrada e de saída no formato\nsolicitado (hh:mm);\nCaso queira adicionar mais horários para esse dia\nclique em 'Adicionar mais Horários';\nUm par de horários (entrada e saída) deixado em\nbranco não será contabilizado;\nApós informar os horários clique em 'Salvar';\nQuando terminar clique em 'Fechar';\n");
			explicacao.setBounds(379, 75, 369, 188);
			explicacao.setEditable(false);
			explicacao.setForeground(new java.awt.Color(64, 124, 64));
			explicacao.setOpaque(false);
			explicacao.setFont(new java.awt.Font("Monospaced", 0, 12));
		}
		return explicacao;
	}
	
	private JButton getOk() {
		if(ok == null) {
			ok = new JButton();
			ok.setText("Fechar");
			ok.setForeground(new java.awt.Color(144,255,144));
			ok.setBackground(new java.awt.Color(37,101,37));
		}
		return ok;
	}
	
	public void capturaHorarios(final List<String> listaDia) {
		{
			mudaHorarios = new JPanel();
			GroupLayout mudaHorariosLayout = new GroupLayout((JComponent)mudaHorarios);
			mudaHorarios.setLayout(mudaHorariosLayout);
			mudaHorarios.setSize(790, 570);
			mudaHorarios.setBackground(new java.awt.Color(191, 236, 191));
			mudaHorarios.setPreferredSize(new java.awt.Dimension(862, 442));

			posicaoX = 112;
			posicaoY = 42;
			final List<JTextField> campos = new ArrayList<JTextField>();

			if (listaDia.isEmpty()) {
				JTextField campoEntrada = new JTextField();
				campoEntrada.setBounds(posicaoX, posicaoY, 72, 21);
				campos.add(campoEntrada);
				posicaoX += 100;
				JTextField campoSaida = new JTextField();
				campoSaida.setBounds(posicaoX, posicaoY, 72, 21);
				campos.add(campoSaida);
				posicaoX -= 100;
				posicaoY += 50;
				listaDia.add("");
				listaDia.add("");
			} else {
				if (campos.isEmpty()) {
					for (int i = 0; i < listaDia.size(); i += 2) {
						JTextField campoEntrada = new JTextField();
						campoEntrada.setBounds(posicaoX, posicaoY, 72, 21);
						campos.add(campoEntrada);
						posicaoX += 100;
						JTextField campoSaida = new JTextField();
						campoSaida.setBounds(posicaoX, posicaoY, 72, 21);
						campos.add(campoSaida);
						posicaoX -= 100;
						posicaoY += 50;
					}
				}
			}

			for (int i = 0; i < campos.size(); i++) {
				campos.get(i).setText(listaDia.get(i));
				mudaHorarios.add(campos.get(i));
			}

			JButton mais = new JButton("Adicionar mais Horários");
			mais.setBounds(528, 326, 226, 29);
			mais.setForeground(new java.awt.Color(144, 238, 144));
			mais.setBackground(new java.awt.Color(35, 104, 35));
			mais.addActionListener((new java.awt.event.ActionListener() {
				@Override
				public void actionPerformed(ActionEvent arg0) {
					JTextField campoEntrada = new JTextField();
					campoEntrada.setBounds(posicaoX, posicaoY, 72, 21);
					campos.add(campoEntrada);
					posicaoX += 100;
					JTextField campoSaida = new JTextField();
					campoSaida.setBounds(posicaoX, posicaoY, 72, 21);
					campos.add(campoSaida);
					posicaoX -= 100;
					posicaoY += 50;
					listaDia.add("");
					listaDia.add("");
					mudaHorarios.add(campoEntrada);
					mudaHorarios.add(campoSaida);
					tabbed.remove(tabbed.indexOfTab("Horarios do Dia"));
					tabbed.addTab("Horarios do Dia", null,mudaHorarios, null);
				}

			}));

			
				JButton limpa = new JButton("Limpar");
				limpa.setBounds(579, 383, 133, 26);
				limpa.setForeground(new java.awt.Color(144, 238, 144));
				limpa.setBackground(new java.awt.Color(35, 104, 35));
				limpa.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						for (JTextField jt : campos) {
							jt.setText("");
						}
					}

				}));
				
				getOk().addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						tabbed.remove(tabbed.indexOfTab("Horarios do Dia"));
						mudaHorarios = null;
						tabbed.addTab("Configuracoes de Horarios", null, getConfiguraHorarios(), null);
					}

				}));
			
			
				JButton ok2 = new JButton("Salvar");
				ok2.setBounds(579, 430, 133, 26);
				ok2.setForeground(new java.awt.Color(144, 238, 144));
				ok2.setBackground(new java.awt.Color(35, 104, 35));
				ok2.addActionListener((new java.awt.event.ActionListener() {
					@Override
					public void actionPerformed(ActionEvent arg0) {
						for (int j = 0; j < campos.size(); j += 2) {
							
							if (!campos.get(j).getText().equals("")
									|| !campos.get(j + 1).getText().equals("")) {

								if (Verificador.verificaTempo(campos.get(j)
										.getText()
										+ ":00")
										&& Verificador.verificaTempo(campos
												.get(j + 1).getText()
												+ ":00")) {
									listaDia.add(j, campos.get(j).getText());
									listaDia.remove(j + 1);
									listaDia.add(j + 1, campos.get(j + 1)
											.getText());
									listaDia.remove(j + 2);
								} else {
									listaDia.add("");
									listaDia.add("");
									for (int i = 0; i < listaDia.size(); i++) {
										listaDia.add(i, "");
										listaDia.remove(i + 1);
									}
									JOptionPane.showMessageDialog(mudaHorarios,
											"Formato de horario invalido",
											"Atenção!",
											JOptionPane.PLAIN_MESSAGE);
								}
							}
						}
					}

				}));
				mudaHorarios.add(ok2);

				mudaHorariosLayout.setHorizontalGroup(mudaHorariosLayout.createSequentialGroup()
					.addContainerGap()
					.addComponent(getLabelEntrada(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					.addGap(31)
					.addComponent(getLabelSaida(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					.addGap(12)
					.addGroup(mudaHorariosLayout.createParallelGroup()
					    .addGroup(mudaHorariosLayout.createSequentialGroup()
					        .addGap(0, 0, Short.MAX_VALUE)
					        .addComponent(getExplicacao(), GroupLayout.PREFERRED_SIZE, 353, GroupLayout.PREFERRED_SIZE))
					    .addGroup(mudaHorariosLayout.createSequentialGroup()
					        .addGap(60)
					        .addGroup(mudaHorariosLayout.createParallelGroup()
					            .addGroup(mudaHorariosLayout.createSequentialGroup()
					                .addGap(0, 0, Short.MAX_VALUE)
					                .addComponent(mais, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					            .addGroup(mudaHorariosLayout.createSequentialGroup()
					                .addGap(0, 52, Short.MAX_VALUE)
					                .addGroup(mudaHorariosLayout.createParallelGroup()
					                    .addComponent(ok2, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
					                    .addComponent(limpa, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
					                    .addComponent(getOk(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE))
					                .addGap(48)))
					        .addGap(131)))
					.addContainerGap(113, 113));
				mudaHorariosLayout.setVerticalGroup(mudaHorariosLayout.createSequentialGroup()
					.addContainerGap(19, 19)
					.addGroup(mudaHorariosLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(getLabelEntrada(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(getLabelSaida(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(26)
					.addComponent(mais, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					.addGap(16)
					.addComponent(ok2, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)
					.addGap(17)
					.addComponent(limpa, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(getOk(), GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
					.addGap(51)
					.addComponent(getExplicacao(), GroupLayout.PREFERRED_SIZE, 158, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(31, Short.MAX_VALUE));
		}
		

	}
	
	public JPanel getMudaHorarios(List<String> lista) {
		if (mudaHorarios == null)
			capturaHorarios(lista);
		return mudaHorarios;
	}
	
	public void mudaHorariosNaTela(List<String> lista) {
		tabbed.addTab("Horarios do Dia", null, getMudaHorarios(lista), null);
		tabbed.remove(tabbed.indexOfTab("Configuracoes de Horarios"));
	}


}
